package com.zhentao.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhentao.login.service.TRoleService;

import com.zhentao.nlz.project.login.TRole;
import com.zhentao.nlz.project.product.vo.RoleVo;
import com.zhentao.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("role")
public class RoleController {
    @Autowired
    private TRoleService roleService;
    @GetMapping("getrole")
    public Result getrole(RoleVo roleVo){
        return Result.success(roleService.getrole(roleVo));
    }
    @GetMapping("getrolelist")
    public Result getrolelist(){
        return Result.success(roleService.getrolelist());
    }

    @PostMapping("saverole")
    public Result saverole(TRole tRole){
        boolean save=roleService.saverole(tRole);
        return Result.success(save);
    }
    @PostMapping("removeRoleId")
    public Result getRoleId(@RequestParam("id") Integer id){
        boolean save=roleService.removeRoleId(id);
        return Result.success(save);
    }

    @PostMapping("updaterole")
    public Result updaterole(TRole role){
        boolean save=roleService.updaterole(role);
        return Result.success(save);
    }
}
